<?php
use yii\helpers\Url;
use yii\Web\View;
use app\assets\CreativeTemplateAsset;
CreativeTemplateAsset::register($this); 
$this->title = $this->context->pageTitle.Yii::$app->params['titleSuffix'];
$this->params['breadcrumbs'] = [
  \Yii::t('creative-template', 'Creative Template'),
  \Yii::t('common', 'Data')
];
$jsMsgs = $this->context->loadJsMsgs([
  'table',
  'creativeTemplate',
  'dialog'
]);
$this->registerJs("VAM.setVar('LANGUAGE_JS', '".$jsMsgs."');", View::POS_HEAD);
?>
<div class="page-header">
  <h1>
    <?=\Yii::t('creative-template', 'Creative Template')?>
    <small><?=\Yii::t('creative-template', 'Template List')?></small>
<!--     <div class="btn-group pull-right" role="group" aria-label="...">
       <a href="<?php //echo Url::to(['creative-template/new-creative-template']); ?>" class="btn btn-sm btn-success" id="new-operate-btn">
        <i class="fa fa-plus-circle"></i>
        新增创意模板
      </a>
    </div> -->
  </h1>
</div>
<div class="panel panel-default">
  <!-- <div class="panel panel-dotted">
    <div class="panel-heading">
      <h4>
        <i class="fa fa-filter"></i>
        <?=\Yii::t('common', 'Search Condition')?>
      </h4>
    </div>
    <div class="panel-body">
      <div class="form-horizontal" id="filter-frm">
        <div class="form-group">
          <label class="col-sm-1 control-label pr0">
            <?=\Yii::t('creative-template', 'Creative Type')?>：
          </label>
          <div class="col-sm-11">
            <label class="radio-inline active">
              <input data-column="3" type="radio" name="filter-creative" value="" checked=""> <?=\Yii::t('creative-template', 'All')?>
            </label>
            <label class="radio-inline">
              <input data-column="3" type="radio" name="filter-creative" value="PC"> PC
            </label>
            <label class="radio-inline">
              <input data-column="3" type="radio" name="filter-creative" value="<?=\Yii::t('creative-template', 'Mobile')?>"><?=\Yii::t('creative-template', 'Mobile')?>
            </label>
          </div>
        </div>
      </div>
    </div>
  </div> -->
  <div class="panel-heading"> 
    <i class="fa fa-table"></i>
    <?=\Yii::t('creative-template', 'Template List')?>
    <ul class="list-inline list-unstyled pull-right">
      <li>
        <a class="data-table-refresh" href="#" title="<?=\Yii::t('common', 'Click to refresh data')?>">
          <i class="fa fa-refresh"></i>
        </a>
      </li>
      <li>
        <a href="#">
          <i class="fa fa-chevron-up"></i>
        </a>
      </li>
    </ul>
  </div>
  <div class="panel-body">
    <div id="list-loading-wrap" class="local-loading-wrap"></div>
    <div class="table-responsive">
      <table class="table table-hover table-striped table-bordered table-condensed" id="data-table" data-tag="vm-adserver.creative-template-list">
        <thead class="heading">
          <tr>
            <th class="tab-xs" data-resizable-column-id="id" data-filter="on">ID</th>
            <th class="tab-xlg" data-resizable-column-id="name" data-filter="on"><?=\Yii::t('creative-template', 'Creative Template')?></th>
            <th class="tab-xs" data-resizable-column-id="template" data-filter="on"><?=\Yii::t('creative-template', 'Name')?></th>
            <!-- <th class="tab-xs" data-resizable-column-id="creativeType" data-filter="on"><?=\Yii::t('creative-template', 'Creative Type')?></th>
            <th class="tab-xs" data-resizable-column-id="templateType" data-filter="on"><?=\Yii::t('creative-template', 'Template Type')?></th> -->
            <th class="tab-sl" data-resizable-column-id="modifiedDate" data-filter="on"><?=\Yii::t('creative-template', 'Update Time')?></th>
            <!-- <th class="tab-op" data-resizable-column-id="operate" data-filter="on"><?=\Yii::t('creative-template', 'Actions')?></th> -->
          </tr>
        </thead>
        <tbody>
          <tr role="row">
            <td class="text-center dataTables_empty" colspan="7"><?=\Yii::t('site', 'No Records')?></td>
          </tr>
        </tbody>
      </table>
    </div>
  </div>
</div>
<div id="extra-container"></div>
<?php
  //$dataUrl = Yii::getAlias('@web').'/response/creativeTemplate/creativeTemplateListDataList.php';
  $dataUrl = Url::to(['get-all-template-list']);
  $webEditUrl = Url::to(['web-template-edit']);
  $appEditUrl = Url::to(['app-template-edit']);
  $webTemplatePreviewUrl = Url::to(['web-creative-template-preview']);
  $appTemplatePreviewUrl = Url::to(['app-creative-template-preview']);
  $this->registerJs("VAM.setVar('CREATIVE_TEMPLATE_DATA_LIST','$dataUrl');",View::POS_HEAD);
  $this->registerJs("VAM.setVar('WEB_TEMPLATE_EDIT_URL','$webEditUrl');",View::POS_HEAD);
  $this->registerJs("VAM.setVar('APP_TEMPLATE_EDIT_URL','$appEditUrl');",View::POS_HEAD);
  $this->registerJs("VAM.setVar('LIST_PREVIEW_WEB_OP_URL','$webTemplatePreviewUrl');",View::POS_HEAD);
  $this->registerJs("VAM.setVar('LIST_PREVIEW_APP_OP_URL','$appTemplatePreviewUrl');",View::POS_HEAD);
?>
<script type="text/javascript" >
  requirejs(["<?= Yii::getAlias('@web/').Yii::$app->params['envDir'];?>/js/site.js"], function(common) {
    requirejs(["<?= Yii::getAlias('@web/').Yii::$app->params['envDir'];?>/js/creativeTemplate/creativeTemplateList.js"]);
  });
</script>
